package util;

import java.util.List;

public class PageUtil<E> {

    private List<E> data;
    private int count;
    private int pageNo;
    private int pageSize;
    private int totalPage;
    private int start;
    private int end;
    private int code;

    public PageUtil(List<E> data, int count, int pageNo, int pageSize) {
        this.code =0;
        this.data = data;
        this.count = count;
        this.pageNo = pageNo;
        this.pageSize = pageSize;
        this.totalPage =count%pageSize==0?count/pageSize:count/pageSize+1;
    }


    public List<E> getData() {
        return data;
    }

    public void setData(List<E> data) {
        this.data = data;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public int getPageNo() {
        return pageNo;
    }

    public void setPageNo(int pageNo) {
        this.pageNo = pageNo;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    public int getStart() {
        return start;
    }

    public void setStart(int start) {
        this.start = start;
    }

    public int getEnd() {
        return end;
    }

    public void setEnd(int end) {
        this.end = end;
    }
}
